package com.link2room.aeriabots.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Nakisa on 2016/12/8.
 */
@Entity
@Table(name = "wx_reply_key_mapping")
@DynamicInsert
public class WxReplyKeyMapping extends BaseEntity {

    public static class KeyType {
        /**
         * 关键字
         */
        public static final String TEXT = "text";
        /**
         * qrcode 扫码
         */
        public static final String QRCODE = "qrcode";
    }
    private String keyId;
    private String templateId;
    private String keyType;
    private String keyValue;
    private String keyName;
    private String keyRemark;

    @Basic
    @Column(name = "key_id", nullable = false)
    public String getKeyId() {
        return keyId;
    }

    public void setKeyId(String keyId) {
        this.keyId = keyId;
    }

    @Basic
    @Column(name = "template_id", nullable = true, length = 32)
    public String getTemplateId() {
        return templateId;
    }

    public void setTemplateId(String templateId) {
        this.templateId = templateId;
    }

    @Basic
    @Column(name = "key_type", nullable = true, length = 16)
    public String getKeyType() {
        return keyType;
    }

    public void setKeyType(String keyType) {
        this.keyType = keyType;
    }

    @Basic
    @Column(name = "key_value", nullable = true, length = 32)
    public String getKeyValue() {
        return keyValue;
    }

    public void setKeyValue(String keyValue) {
        this.keyValue = keyValue;
    }
    @Basic
    @Column(name = "key_name", nullable = true, length = 32)
    public String getKeyName() {
        return keyName;
    }

    public void setKeyName(String keyName) {
        this.keyName = keyName;
    }
    @Basic
    @Column(name = "key_remark", nullable = true, length = 32)
    public String getKeyRemark() {
        return keyRemark;
    }

    public void setKeyRemark(String keyRemark) {
        this.keyRemark = keyRemark;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        WxReplyKeyMapping that = (WxReplyKeyMapping) o;

        if (keyId != that.keyId) return false;
        if (templateId != null ? !templateId.equals(that.templateId) : that.templateId != null) return false;
        if (keyType != null ? !keyType.equals(that.keyType) : that.keyType != null) return false;
        if (keyValue != null ? !keyValue.equals(that.keyValue) : that.keyValue != null) return false;
        if (keyName != null ? !keyName.equals(that.keyName) : that.keyName != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = keyId != null ? keyId.hashCode() : 0;
        result = 31 * result + (templateId != null ? templateId.hashCode() : 0);
        result = 31 * result + (keyType != null ? keyType.hashCode() : 0);
        result = 31 * result + (keyValue != null ? keyValue.hashCode() : 0);
        result = 31 * result + (keyName != null ? keyName.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "WxReplyKeyMapping{" +
                "keyId='" + keyId + '\'' +
                ", templateId='" + templateId + '\'' +
                ", keyType='" + keyType + '\'' +
                ", keyValue='" + keyValue + '\'' +
                ", keyName='" + keyName + '\'' +
                ", keyRemark='" + keyRemark + '\'' +
                '}';
    }
}
